package com.icoo.client.controller;

import com.icoo.base.model.ResultModel;
import com.icoo.client.feign.OrderFeign;
import com.icoo.client.model.OrderVo;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/client")
@Api("客户端")
public class ClientController {

    @Autowired private OrderFeign orderFeign;

    @PostMapping("/createOrder")
    @Operation(summary = "下单")
    public ResultModel converOrder(@Valid OrderVo orderVos){
        orderFeign.createOrder(orderVos);
        return ResultModel.success();
    }
}
